package cn.tl.hrm.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "course",type = "_doc")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseDoc {
    //对应ES的文档ID
    @Id
    private Long id;

    //课程名字
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;

    //@Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    //private String searchField; // name + tenantName

    //课程等级
    @Field(type = FieldType.Keyword)
    private String gradeName;

    @Field(type = FieldType.Long)
    private Long courseTypeId;

    @Field(type = FieldType.Keyword)
    private String tenantName;

    @Field(type = FieldType.Keyword)
    private String pic;

    @Field(type = FieldType.Integer)
    private Integer saleCount;

    @Field(type = FieldType.Integer)
    private Integer viewCount;

    @Field(type = FieldType.Integer)
    private Integer commentCount;

    //免费 ，收费
    @Field(type = FieldType.Keyword)
    private String chargeName;

    @Field(type = FieldType.Float)
    private Float price;

    @Field(type = FieldType.Float)
    private Float priceOld;

    @Field(type = FieldType.Date)
    private Date onlineTime;
}
